package com.example.protocol;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import com.alibaba.fastjson.JSON;

import com.example.api.PeopleManage;
import com.example.dto.PeopleDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2022/8/7 08:12
 */
@Slf4j
@DubboService(interfaceClass = PeopleManage.class, retries = 0)
public class PeopleManageImpl implements PeopleManage {

    @Override
    @GET
    @Path("/{id}")
    public PeopleDto getUserNameById(@PathParam("id") Integer id) {
        PeopleDto peopleDto = new PeopleDto();
        peopleDto.setId(id);
        peopleDto.setUserName("用户姓名 id" + id);
        log.info("getUserNameById :{}", JSON.toJSONString(peopleDto));
        return peopleDto;
    }
}
